﻿using System;
using System.Diagnostics.Contracts;
using System.IO;
using OpenLS.Spreadsheet.Formats.Biff.Tokens;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal class CFVOParsedFormula : ParsedFormulaBase
    {
       public void Read (BinaryReader reader)
       {
           var length = reader.ReadUInt16();
           if (length > 0)
           {
               Contract.Assert(length > 0);
               this.Read(new FormulaReadContext(reader, FormulaReadContextType.Default), length);
           }
       }
        protected override Cell GetReferenceCell(Cell cell)
        {
            throw new NotImplementedException();
        }

        public void Write(BinaryWriter writer)
        {
            writer.Write((ushort)this.TotalTokenByteLength(FormulaReadContextType.Default));
            base.WriteNoLength(new FormulaWriteContext(writer, FormulaReadContextType.Default));
        }
    }
}